<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>系统配置</title>
    <script src="../../../static/kaige/js/szload.js"></script>
    <style>
        .config-form .layui-form-item .layui-input-inline {
            width: 500px;
        }

        .hr-line-dashed {
            display: block;
            width: 100%;
            height: 0;
            border-bottom: 1px dashed #e6e6e6;
            margin: 15px auto;
            font-size: 0;
        }

        .uploadimgbtn {
            margin-top: 4px;
        }

        .layui-form .layui-form-item .labelnobb {
            border: 0;
            background-color: transparent;
        }

        .layui-form .layui-form-item .layui-form-label {
            width: 160px;
        }
    </style>
</head>

<body>
    <div class="kaige-body" id="sysconfig_form"></div>

    <script>
        load_init_js(function () {
            layui.config({
                base: szoapcpath + '/static/kaige/layuiextend/'
            }).use(['form', 'jquery', 'element', 'kaige'], function () {
                var form = layui.form, layer = layui.layer, $ = layui.jquery, element = layui.element, kaige = layui.kaige;

                kaige.form({
                    opentype: 'dom'  // 写dom 非弹窗 必填此项
                    , url: '/sys.config/index'
                    , box: 'sysconfig_form'
                    , id: 'kaige'
                    , encode:1
                });

                //图片预览
                $('img').on('click', function (e) {
                    var url = $(this).attr('src');
                    kaige.viewimage({ maxwidth: 600, maxheight: 600, url: url });
                });

                //浏览器图标上传
                kaige.upload_multi_files({
                    input_id: '#inputimgguid',
                    img_id: '#srcimgurl',
                    btn: '#editimg',
                    url: szoapcpath + '/pages/files/upfiles.html?id=7'
                });
            });
        });
    </script>
    <script type="text/html" id="kaige_form_html">
        <div class="layui-tab layui-tab-card" style="margin-top: 0;" lay-filter="config-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">平台配置</li>
                <li>微信接口</li>
                <li>邮件接口</li>
                <li>第三方</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <!--平台设置-->
                    <form class="layui-form layui-form-pane config-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">App名称</label>
                            <div class="layui-input-inline">
                                <input name="app_name" required="required" placeholder="请输入程序名称" value="{{ d.app_name || '' }}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">App版本</label>
                            <div class="layui-input-inline">
                                <input name="app_version" required="required" placeholder="请输入程序版本" value="{{ d.app_version || '' }}" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">网站标题</label>
                            <div class="layui-input-inline">
                                <input name="site_title" required="required" placeholder="请输入网站名称" value="{{ d.site_title || '' }}" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">Copyright</label>
                            <div class="layui-input-inline">
                                <input name="site_copy" required="required" placeholder="请输入版权信息" value="{{ d.site_copy || '' }}" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">浏览器图标</label>
                            <div class="layui-input-inline">
                                <img id="srcimgurl" style="height:auto;max-height:32px;min-width:32px;margin: auto 10px;" src="{{ d.browser_icon_url || '' }}" />
                                <input type="hidden" name="browser_icon" id="inputimgguid" value="{{ d.browser_icon || '' }}" class="layui-input">
                                <a class="layui-btn layui-btn-sm uploadimgbtn" id="editimg"><i class="fa fa-upload"></i>上传图片</a>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">网站备案</label>
                            <div class="layui-input-inline">
                                <input name="miitbeian" title="请输入网站备案号" placeholder="请输入网站备案号" value="{{ d.miitbeian || '' }}" class="layui-input">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="layui-form-item">
                            <label class="layui-form-label labelnobb"></label>
                            <div class="layui-input-inline">
                                <button class="layui-btn" lay-submit lay-filter="kaige_form_btn_save"><i class="fa fa-save"></i> 保存配置</button>
                            </div>
                        </div>
                    </form>
                </div>

                <div class="layui-tab-item">
                    <form class="layui-form dwc-body layui-form-pane officialform" lay-filter="officialform">
                        <blockquote class="layui-elem-quote">
                            <p>请先登录公众平台<a href="javascript:;" id="wailian_weixin" lay-href="https://mp.weixin.qq.com">mp.weixin.qq.com</a>配置url，再根据页面要求填写信息并保存</p>
                        </blockquote>
                        <div class="layui-form-item">
                            <label class="layui-form-label">接口地址</label>
                            <div class="layui-form-mid" style="margin-left: 10px;">域名/wechat</div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="layui-badge-dot"></span>公众号名称</label>
                            <div class="layui-input-inline">
                                <input type="text" required lay-verify="required" name="wx_official_app_name" value="{{ d.wx_official_app_name || '' }}" class="layui-input"
                                    lay-reqText="请输入公众号名称" class="layui-input">
                            </div>
                            <label class="layui-form-label"><span class="layui-badge-dot"></span>微信号</label>
                            <div class="layui-input-inline">
                                <input type="text" required lay-verify="required" name="wx_official_wx_id" value="{{ d.wx_official_wx_id || '' }}" class="layui-input" lay-reqText="请输入微信号" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="layui-badge-dot"></span>AppId</label>
                            <div class="layui-input-inline">
                                <input type="text" name="wx_official_app_id" required lay-verify="required" value="{{ d.wx_official_app_id || '' }}" autocomplete="off" lay-reqText="请输入公众号AppId" class="layui-input">
                            </div>
                            <label class="layui-form-label"><span class="layui-badge-dot"></span>AppSecret</label>
                            <div class="layui-input-inline">
                                <input type="text" name="wx_official_app_secret" required lay-verify="required" value="{{ d.wx_official_app_secret|| ''}}" autocomplete="off" lay-reqText="请输入公众号AppSecret" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="layui-badge-dot"></span>公众号原始ID</label>
                            <div class="layui-input-inline">
                                <input type="text" name="wx_official_original_id" required lay-verify="required"
                                    value="{{ d.wx_official_original_id || '' }}" autocomplete="off"
                                    lay-reqText="请输入公众号原始ID" class="layui-input">
                            </div>
                            <label class="layui-form-label"><span class="layui-badge-dot"></span>公众号类型</label>
                            <div class="layui-input-inline">
                                <input type="radio" name="wx_official_type" value="service" title="服务号" {{# if (d.wx_official_type=='service'){ }} checked {{# } }} >
                                <input type="radio" name="wx_official_type" value="subscribe" title="订阅号" {{# if (d.wx_official_type=='subscribe'){ }} checked {{# } }}>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="layui-badge-dot"></span>微信验证TOKEN</label>
                            <div class="layui-input-inline">
                                <input type="text" name="wx_official_token" required lay-verify="required"
                                    value="{{ d.wx_official_token || '' }}" autocomplete="off"
                                    lay-reqText="微信验证TOKEN" class="layui-input">
                            </div>
                            <label class="layui-form-label">公众号二维码</label>
                            <div class='layui-inline' style="margin-left: 10px;">
                                <img id="srcimgurl" style="height:auto;max-height:32px;min-width:32px" src="{{ d.wx_official_code_img_url || '' }}" />
                                <input type="hidden" name="wx_official_code_img" id="inputimgguid" value="{{ d.wx_official_code_img || ''}}">
                            </div>
                            <div class='layui-inline'>
                                <a class="layui-btn layui-btn-sm" id="editimg" style="margin-top: 4px;">上传图片</a>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">EncodingAESKey</label>
                            <div class="layui-input-inline">
                                <input type="text" name="wx_official_EncodingAESKey"
                                    value="{{ d.wx_official_encodeaeskey || ''}}" autocomplete="off" placeholder="" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">如公众号中消息加解密方式为安全模式，此项必填</div>
                        </div>
                        <div class="layui-form-item" style="margin-top: 15px;">
                            <div class='layui-inline' style="margin-left: 150px;">
                                <button class="layui-btn" lay-submit="" lay-filter="kaige_form_btn_save"><i class="fa fa-save"></i> 保存配置</button>
                            </div>
                        </div>
                    </form>
                </div>

                <div class="layui-tab-item">
                    <form class="layui-form layui-form-pane">
                        <div class="layui-form-item">
                            <label class="layui-form-label">其它...</label>
                            <div class="layui-input-inline">
                                <input type="text"  value="" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">更多</div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="layui-form-item">
                            <label class="layui-form-label labelnobb"></label>
                            <div class="layui-input-inline">
                                <button class="layui-btn" lay-submit lay-filter="kaige_form_btn_save"><i class="fa fa-save"></i>
                                    保存配置</button>
                            </div>
                        </div>
                    </form>
                </div>

                <div class="layui-tab-item">
                    <form class="layui-form layui-form-pane">
                        <div class="layui-form-item">
                            <label class="layui-form-label">腾讯地图接口</label>
                            <div class="layui-input-inline" style="width: 400px;">
                                <input type="text" name="tmap_key" value="{{ d.tmap_key || '' }}" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid">
                                <a target="_blank" href="https://lbs.qq.com/dev/console/application/mine">【进入腾讯控制台】</a>创建应用,勾选【WebServiceAPI】选择【授权IP】
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="layui-form-item">
                            <label class="layui-form-label labelnobb"></label>
                            <div class="layui-input-inline">
                                <button class="layui-btn" lay-submit lay-filter="kaige_form_btn_save"><i class="fa fa-save"></i> 保存配置 </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </script>
</body>

</html>